package dch.entity;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

public class Video{

	// Fields

	private Integer videoid;
	private Album album=new Album();
	private String title;
	private Timestamp publishtime;
	private String videopath;

	// Constructors

	/** default constructor */
	public Video() {
	}

	/** full constructor */
	public Video(Album album, String title) {
		this.album = album;
		this.title = title;
	}

	public Integer getVideoid() {
		return this.videoid;
	}

	public void setVideoid(Integer videoid) {
		this.videoid = videoid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "albumid")
	public Album getAlbum() {
		return this.album;
	}

	public void setAlbum(Album album) {
		this.album = album;
	}

	@Column(name = "title", length = 200)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name="videopath",length=100)
	public String getVideopath(){
		return this.videopath;
	}
	
	public void setVideopath(String videopath){
		this.videopath=videopath;
	}
	
	@Column(name = "publishtime", length = 19)
	public Timestamp getPublishtime() {
		return this.publishtime;
	}

	public void setPublishtime(Timestamp publishtime) {
		this.publishtime = publishtime;
	}

}